# coding: utf-8

#
# 获得文件夹的大小
# @author wangtao
# @version 2011.07.10
#


import os
import sys
from os.path import join, getsize

inputdir = sys.argv[1]

def getdirsize(dir):
    size = 0L
    for root, dirs, files in os.walk(dir):
        size += sum([getsize(join(root, name)) for name in files])
    return size


if __name__ == "__main__":
    filesize = getdirsize(inputdir)
    print filesize
